import 'package:kkhousekeep/generated/json/base/json_convert_content.dart';
import 'package:kkhousekeep/models/property_order_detail_entity.dart';

PropertyOrderDetailEntity $PropertyOrderDetailEntityFromJson(Map<String, dynamic> json) {
	final PropertyOrderDetailEntity propertyOrderDetailEntity = PropertyOrderDetailEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		propertyOrderDetailEntity.code = code;
	}
	final PropertyOrderDetailObj? obj = jsonConvert.convert<PropertyOrderDetailObj>(json['obj']);
	if (obj != null) {
		propertyOrderDetailEntity.obj = obj;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		propertyOrderDetailEntity.msg = msg;
	}
	return propertyOrderDetailEntity;
}

Map<String, dynamic> $PropertyOrderDetailEntityToJson(PropertyOrderDetailEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['obj'] = entity.obj.toJson();
	data['msg'] = entity.msg;
	return data;
}

PropertyOrderDetailObj $PropertyOrderDetailObjFromJson(Map<String, dynamic> json) {
	final PropertyOrderDetailObj propertyOrderDetailObj = PropertyOrderDetailObj();
	final int? area = jsonConvert.convert<int>(json['area']);
	if (area != null) {
		propertyOrderDetailObj.area = area;
	}
	final String? address = jsonConvert.convert<String>(json['address']);
	if (address != null) {
		propertyOrderDetailObj.address = address;
	}
	final String? reporter = jsonConvert.convert<String>(json['reporter']);
	if (reporter != null) {
		propertyOrderDetailObj.reporter = reporter;
	}
	final String? phone = jsonConvert.convert<String>(json['phone']);
	if (phone != null) {
		propertyOrderDetailObj.phone = phone;
	}
	final int? urgency = jsonConvert.convert<int>(json['urgency']);
	if (urgency != null) {
		propertyOrderDetailObj.urgency = urgency;
	}
	final String? fatalType = jsonConvert.convert<String>(json['fatalType']);
	if (fatalType != null) {
		propertyOrderDetailObj.fatalType = fatalType;
	}
	final String? fatalDesc = jsonConvert.convert<String>(json['fatalDesc']);
	if (fatalDesc != null) {
		propertyOrderDetailObj.fatalDesc = fatalDesc;
	}
	final List<String>? pics = jsonConvert.convertListNotNull<String>(json['pics']);
	if (pics != null) {
		propertyOrderDetailObj.pics = pics;
	}
	final List<PropertyOrderDetailObjRecord>? record = jsonConvert.convertListNotNull<PropertyOrderDetailObjRecord>(json['record']);
	if (record != null) {
		propertyOrderDetailObj.record = record;
	}
	return propertyOrderDetailObj;
}

Map<String, dynamic> $PropertyOrderDetailObjToJson(PropertyOrderDetailObj entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['area'] = entity.area;
	data['address'] = entity.address;
	data['reporter'] = entity.reporter;
	data['phone'] = entity.phone;
	data['urgency'] = entity.urgency;
	data['fatalType'] = entity.fatalType;
	data['fatalDesc'] = entity.fatalDesc;
	data['pics'] =  entity.pics;
	data['record'] =  entity.record.map((v) => v.toJson()).toList();
	return data;
}

PropertyOrderDetailObjRecord $PropertyOrderDetailObjRecordFromJson(Map<String, dynamic> json) {
	final PropertyOrderDetailObjRecord propertyOrderDetailObjRecord = PropertyOrderDetailObjRecord();
	final String? time = jsonConvert.convert<String>(json['time']);
	if (time != null) {
		propertyOrderDetailObjRecord.time = time;
	}
	final String? xOperator = jsonConvert.convert<String>(json['operator']);
	if (xOperator != null) {
		propertyOrderDetailObjRecord.xOperator = xOperator;
	}
	final String? operation = jsonConvert.convert<String>(json['operation']);
	if (operation != null) {
		propertyOrderDetailObjRecord.operation = operation;
	}
	return propertyOrderDetailObjRecord;
}

Map<String, dynamic> $PropertyOrderDetailObjRecordToJson(PropertyOrderDetailObjRecord entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['time'] = entity.time;
	data['operator'] = entity.xOperator;
	data['operation'] = entity.operation;
	return data;
}